import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/components/layout/Layout.vue'
import AppView from '@/components/layout/AppView.vue'
// 路由配置
const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '', // 默认子路由
        component: AppView,
        children: [
          {
            path: '/user',
            component: () => import("@/views/User.vue")
          }
        ]
      }
    ]

  },
  // 404页面
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('../views/NotFound.vue')
  },


]

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes
})


export default router
